import CryptoJS from 'crypto-js'

const SECRET_KEY = '9da7a56e9ab48a414c7d73184c312f4e' // Replace with a secure key

export const encrypt = (text: string): string => {
    return CryptoJS.AES.encrypt(text, SECRET_KEY).toString()    // 加密
}

export const decrypt = (ciphertext: string): string => {
    const bytes = CryptoJS.AES.decrypt(ciphertext, SECRET_KEY)
    return bytes.toString(CryptoJS.enc.Utf8)    // 解密
}
// console.log(encrypt('我是靓仔'))
